Update Get-SfAccount and Get-SfOpportunity functions with ID support and add URL ID extraction#22
Update Get-SfAccount and Get-SfOpportunity functions with ID support and add URL ID extraction#22
Conversation
| # PowerShell module to get the ID from a Service Fabric URL | ||
| # Allow to integrate with ProjectHelper returning SfId | ||
|
|
||
| function Get-SfIdFromUrl{ |
Check notice
Code scanning / PSScriptAnalyzer
The cmdlet 'Get-SfIdFromUrl' does not have a help comment. Note
|
|
||
| # Extract Id from URL | ||
| $Id = Get-SfObjectIdFromUrl -SfUrl $SfUrl | ||
|
|
Check notice
Code scanning / PSScriptAnalyzer
Line has trailing whitespace Note
| $ret = @{ | ||
| SfId = $Id | ||
| } | ||
|
|
Check notice
Code scanning / PSScriptAnalyzer
Line has trailing whitespace Note
| SfId = $Id | ||
| } | ||
|
|
||
| return $ret |
Check notice
Code scanning / PSScriptAnalyzer
The cmdlet 'Get-SfIdFromUrl' returns an object of type 'System.Collections.Hashtable' but this type is not declared in the OutputType attribute. Note
| if ($type -ne "Account") { | ||
| throw "Invalid Salesforce Object URL $SfUrl" | ||
| if ([string]::IsNullOrWhiteSpace($Id)){ | ||
|
|
Check notice
Code scanning / PSScriptAnalyzer
Line has trailing whitespace Note
| # Extract Id from URL | ||
| $Id = Get-SfObjectIdFromUrl -SfUrl $SfUrl | ||
| $type = Get-SfObjectTypeFromUrl -SfUrl $SfUrl | ||
|
|
Check notice
Code scanning / PSScriptAnalyzer
Line has trailing whitespace Note
| # Extract Id from URL | ||
| $Id = Get-SfObjectIdFromUrl -SfUrl $SfUrl | ||
| $type = Get-SfObjectTypeFromUrl -SfUrl $SfUrl | ||
|
|
Check notice
Code scanning / PSScriptAnalyzer
Line has trailing whitespace Note
Enhance the Get-SfAccount and Get-SfOpportunity functions to accept an ID parameter, allowing users to query directly by ID. Introduce a new function, Get-SfIdFromUrl, to extract IDs from Service Fabric URLs. Update documentation and tests accordingly.